package com.example.myapplication;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

public class ScanPayActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_scan_pay);

        // 初始化支付卡片
        findViewById(R.id.card_bank_of_china).setOnClickListener(this::onPaymentOptionSelected);
        findViewById(R.id.card_construction_bank).setOnClickListener(this::onPaymentOptionSelected);
        findViewById(R.id.card_agriculture_bank).setOnClickListener(this::onPaymentOptionSelected);
        findViewById(R.id.card_alipay).setOnClickListener(this::onPaymentOptionSelected);
        findViewById(R.id.card_wechat_pay).setOnClickListener(this::onPaymentOptionSelected);
    }

    // 支付选项点击事件
    private void onPaymentOptionSelected(View view) {
        Toast.makeText(this, "支付成功", Toast.LENGTH_SHORT).show();
    }
}
